/* 公共样式 - 用于所有管理页面 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4facfe;
    --secondary-color: #00f2fe;
    --success-color: #26de81;
    --danger-color: #ff4757;
    --warning-color: #ffa502;
    --info-color: #45aaf2;
    --dark-color: #2f3542;
    --light-color: #f1f2f6;
    --border-color: #dfe4ea;
    --text-color: #2f3542;
    --text-muted: #747d8c;
    --sidebar-width: 250px;
    --header-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: var(--text-color);
}

/* 主布局 */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #1ecad3 0%, #11a5bb 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 36px;
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.12);
    padding-left: 25px;
}

.menu-item.active {
    background-color: rgba(255, 255, 255, 0.25);
    border-left: 4px solid white;
}

.menu-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* 主内容区域 */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.top-navbar {
    height: var(--header-height);
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-left h1 {
    font-size: 20px;
    color: var(--text-color);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1ecad3, #11a5bb);
.calendar-wrapper {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
    gap: 24px;
}

.calendar-card {
    padding: 0;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 10px;
}

.calendar-header h3 {
    font-size: 20px;
    color: var(--text-color);
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-nav button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    padding: 0 24px 8px 24px;
    gap: 8px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    padding: 0 24px 24px;
    gap: 10px;
}

.calendar-day {
    min-height: 90px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-day:hover:not(.calendar-empty) {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.calendar-day.other-month {
    background: #f4f6fb;
    color: var(--text-muted);
    cursor: default;
}

.calendar-day.has-appointments {
    border: 2px solid #ff6b6b;
    background: radial-gradient(circle at top, rgba(255,107,107,0.12), rgba(255,255,255,0));
}

.calendar-day.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 8px 16px rgba(17,165,187,0.25);
}

.calendar-day-number {
    font-weight: 600;
    font-size: 16px;
}

.calendar-day-count {
    font-size: 13px;
    text-align: right;
    color: #ff6b6b;
    font-weight: 600;
}

.calendar-day-dot {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff6b6b;
}

.calendar-empty {
    border: none;
    background: transparent;
    cursor: default;
}

.calendar-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-detail-date {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

@media (max-width: 992px) {
    .calendar-wrapper {
        grid-template-columns: 1fr;
    }

    .calendar-grid,
    .calendar-weekdays {
        padding: 0 16px 16px;
    }
}
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-name {
    font-size: 14px;
    color: var(--text-color);
}

.btn-logout {
    padding: 8px 16px;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background-color: #e84118;
    transform: translateY(-2px);
}

/* 内容区域 */
.content-area {
    padding: 30px;
    flex: 1;
}

/* 页面标题 */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.card-body {
    padding: 0;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-secondary {
    background-color: var(--text-muted);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background-color: var(--light-color);
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 提示消息 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-icon.success {
    background: linear-gradient(135deg, #26de81, #20bf6b);
}

.stat-icon.danger {
    background: linear-gradient(135deg, #ff4757, #e84118);
}

.stat-icon.warning {
    background: linear-gradient(135deg, #ffa502, #ff7f00);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 14px;
    color: var(--text-muted);
}

/* 低库存预警提示条 */
.low-stock-alert-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    background: linear-gradient(135deg, #ffa502, #ff7f00);
    color: white;
    padding: 12px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}

.low-stock-alert-bar.show {
    display: flex;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.low-stock-alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.low-stock-alert-icon {
    font-size: 20px;
}

.low-stock-alert-text {
    font-size: 14px;
    font-weight: 500;
}

.low-stock-alert-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.low-stock-alert-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 当有预警提示时，调整内容区域的上边距 */
.main-content.has-alert {
    margin-top: 48px;
}

/* 响应式 */
@media (max-width: 768px) {
    .low-stock-alert-bar {
        left: 0;
    }
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

